package com.hopu.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("page")
public class PageController {

    //RequestMapping是配置URL index---> http://localhost:8080/springmvc/index
    @RequestMapping(value = "index",method = RequestMethod.GET)
    public String index(){
        System.out.println("访问index页面");
        //返回的index字符串，交给视图解析器处理：前缀+字符串+后缀--->/WEB-INF/jsp/index.jsp
        return "index";
    }

    @RequestMapping("login")
    public String login(){
        return "login";
    }

    @RequestMapping("test")
    public String test(){
        return "test";
    }

    @RequestMapping("upload")
    public String upload(){
        return "upload";
    }
}
